/* Copyright (C) 2009 Alvaro Morais <alvaromorais@gmail.com>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details at
 * http://www.gnu.org/copyleft/gpl.html
 */

#ifndef CURSESWINDOW_H
#define CURSESWINDOW_H

#include <config.h>
#include <ncurses.h>
#include <iostream>
#include <signal.h>
#include <list>
#include <iterator>
#include <time.h>

using namespace std;

//void resizeHandler(int);
//void associateHandler();

class CursesWindow
{
public:
    CursesWindow();
    ~CursesWindow();

    string password;
    string host;
    string lastMessageFromServer;
    unsigned updateTime;

private:
    int main_x, main_y, main_width, main_height;
    WINDOW* main_window;
    void drawMainWindow();
    void writeHeaders();
    void initColors();
    void waitInput();
    bool screenSupportColors;
    clock_t lastTimeRead;

    void signalWindowResized();
    static bool checkIfResized();




    //friend void resizeHandler(int);
};

#endif // CURSESWINDOW_H
